import React from 'react';
import {WeaSearchGroup} from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import EType from './base/EType';
import ETitle from './base/ETitle';
import EShowNum from './base/EShowNum';
import ELinkMode from './base/ELinkMode';
//import EField from './base/EField';
import EScrollDirection from './base/EScrollDirection';
import ERemindMode from './base/ERemindMode';
import DataSourceTable from './base/DataSourceTable';
import EShowHeader from "./base/EShowHeader";

// 流程中心
class Content_8 extends React.Component {
    render() {
        const {hpid, eid, ebaseid, eShareLevel, synergyParams} = this.props;
        let __DataSourceTable = <div></div>;
        if (eShareLevel == '2') {
            __DataSourceTable = <DataSourceTable ecId={`${this && this.props && this.props.ecId || ''}_DataSourceTable@e8qj8l`} ref="dataSourceTable" hpid={hpid} eid={eid} ebaseid={ebaseid} {...this.props.eTabs} synergyParams={synergyParams}/>;
        }

        return (
            <div>
                <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@gl2ihs`} title={getLabel(81711, '基本信息')} needTigger={true} showGroup={true}>
                    <EType ecId={`${this && this.props && this.props.ecId || ''}_EType@kc8znj`} ref="eType" value={this.props.eBaseName}/>
                    {this.props.eShareLevel == '2' ? <ETitle ecId={`${this && this.props && this.props.ecId || ''}_ETitle@u7nebu`} ref="eTitle" eid={this.props.eid} value={this.props.eTitle} {...this.props}/> : ''}
                    <EShowNum ecId={`${this && this.props && this.props.ecId || ''}_EShowNum@mwdc80`} ref="eShowNum" value={this.props.eShowNum}/>
                    <ELinkMode ecId={`${this && this.props && this.props.ecId || ''}_ELinkMode@27t3sw`} ref="eLinkMode" options={this.props.eLinkMode.options} value={this.props.eLinkMode.selected}/>
                    <EShowHeader ecId={`${this && this.props && this.props.ecId || ''}_EShowHeader@wxon4s`} ref="eShowHeader" value={this.props.showHeader}/>
                   {/* {this.props.eShareLevel == '2' ? <EScrollDirection ref="eScrollDirection" options={this.props.eScrollDirection.options} value={this.props.eScrollDirection.selected}/> : ''}*/}
                    <ERemindMode ecId={`${this && this.props && this.props.ecId || ''}_ERemindMode@ywhxhj`} ref="eRemindMode" value={this.props.eRemindMode}/>
                </WeaSearchGroup>
                {__DataSourceTable}
            </div>
        );
    }

    getSaveValues() {
        return {
            eContentTitle: this.refs['eTitle'] ? this.refs['eTitle'].getSaveValues() : this.props.eTitle,
            eContentShowNum: this.refs['eShowNum'].getSaveValues(),
            eContentLinkMode: this.refs['eLinkMode'].getSaveValues(),
            eContentShowHeader: this.refs['eShowHeader'].getSaveValues(),
            eContentScrollDirection: this.refs['eScrollDirection'] ? this.refs['eScrollDirection'].getSaveValues() : this.props.eScrollDirection.selected,
            eContentRemindMode: this.refs['eRemindMode'].getSaveValues(),
            eContentTabWidth: {tabwidth: this.props.etabwidth, methodvalue: this.props.methodvalue},
            eContentIsAlwaysShow: this.props.isAlwaysShow,
            eContenteTabStyle: {tabstyle: this.props.tabstyle, tabvalue: this.props.tabvalue, tabname: this.props.tabname},
            eTabs: this.refs['dataSourceTable'] ? this.refs['dataSourceTable'].getSaveValues() : {}
        };
    }
}

export default Content_8;
